The present invention relates to the field of compression and decompression systems; more particularly, the present invention relates to compression/decompression of binary images via sampling.
Downsampling and upsampling of data are well known in the art. In binary images, downsampling often refers to a sampling of the image data by a factor of two in both the horizontal and vertical directions. Upsampling refers to reconstruction from the subsampled image by expanding the data by a factor of two in the horizontal direction and by a factor of two in the vertical direction.
Numerous downsampling methods are well known in the art. For instance, the downsampled pixel value of a block of pixels in an image may be the medium value of all pixels in that block. In another implementation, where the block size is four pixels, which is typical, the values of the pixels in the block may be added together and divided by four. In still another implementation, one of the pixel values, such as the upper left corner pixel value, may be taken to represent all the pixel values in the block.
Current products perform downsampling and/or upsampling. For instance, Integrated Device Technology, of Santa Clara, Calif., sells an integrated circuit chip implementing lossy compression by run-length coding and Lempel-Ziv coding. The lossy compression uses a simple downsampling method for compression, and replication with smoothing for upsampling.
Replication refers to the duplication of a downsampled value in both the horizontal and vertical directions to reconstruct an original image. Replication with smoothing allows for selecting pixel values based not only on a downsampled value that is being upsampled but on neighboring pixel values as well.
The JBIG (lossless binary compression) Standard specifies a method to reduce the binary image so as to maintain horizontal, vertical and diagonal lines and edges and to maintain some patterns. For instance, see ISO IS 11544 (ITU-¶.82). The standard, however, only discusses the use of the low resolution image and using compressed data to recreate the lossless high resolution data.
Downsampling data by a factor of two in each direction (horizontal and vertical) clearly guarantees that only one quarter of the image. This guarantee is very beneficial, but the image quality that results from upsampling for reconstruction later may not be good. Therefore, it would be desirable to increase the image quality that results after upsampling a downsampled image or other set of data while ensuring that the bit rate remains constant.
A method and apparatus for compressing information is described. The present invention includes a method and apparatus for receiving binary pixel values and for downsampling the binary pixel values to generate a downsampled pixel value for each block of binary pixel values. The downsampled pixel values for each block of pixel values is generated based on a summation of pixel values in each block and at least one other value generated as a result of previously downsampling another block of pixels which is in a predetermined causal relationship with that particular block of pixel values.
The present invention also provides for processing information through the use of a method and apparatus for receiving downsampled pixel values and for upsampling each of the downsampled pixel values to construct a block of upsampled pixel values using statistics based on template pattern values of a predetermined number of downsampled pixel values.